import React from 'react';
import { View, Text, Button } from 'react-native';

class DetailsScreen extends React.Component {
    static navigationOptions = ({ navigation }) => {
        return {title: navigation.getParam('otherParam', 'A Nested DETAILS sCREEN') };
    };
    render() {
        return (
            <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
                <Text>Details Screen</Text>
                <Button title="跳转详情页" onPress={ () => this.props.navigation.push('Details') } />
                <Button title="GOto home" onPress={() => this.props.navigation.navigate('Details')} />
                <Button title="返回" onPress={ ()=> this.props.navigation.goBack() } />
                <Button title="Update the title" onPress={ () => this.props.navigation.setParams({ otherParam: 'Updated!'}) } />
            </View>
        );
    }
}

export default DetailsScreen;
